package com.blog.study.study5;

import java.util.concurrent.DelayQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * ScheduledThreadPoolExecutor测试类.
 *
 * @author 张俊强~.
 * @date 2017/11/24-11:44.
 */
public class ScheduledThreadPoolExecutorProgram {

    public static void main(String[] args) {
//        DelayedWorkQueue delayedWorkQueue=new DelayedWorkQueue();
        DelayQueue delayQueue=new DelayQueue();

        ScheduledThreadPoolExecutor poolExecutor = new ScheduledThreadPoolExecutor(10);
        poolExecutor.scheduleAtFixedRate(() ->
                System.out.println("RUN"), 5000,1000, TimeUnit.MILLISECONDS);
    }

}
